Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue SDK: stop passing down unused props #3891

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

samijaber
Copy link
Contributor

Copy link

changeset-bot bot commented Feb 4, 2025

⚠️ No Changeset found

Latest commit: 157e72f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

nx-cloud bot commented Feb 4, 2025

View your CI Pipeline Execution ↗ for commit 157e72f.

Command Status Duration Result
nx test @e2e/qwik-city ❌ Failed 6m 40s View ↗
nx test @snippet/angular-16-ssr ❌ Failed 1m 13s View ↗
nx test @snippet/angular-16 ❌ Failed 1m 13s View ↗
nx test @e2e/angular-16-ssr ❌ Failed 1m 21s View ↗
nx test @e2e/angular-19-ssr ❌ Failed 1m 21s View ↗
nx test @e2e/angular-16 ❌ Failed 1m 19s View ↗
nx test @e2e/nextjs-sdk-next-app ✅ Succeeded 7m 42s View ↗
nx test @e2e/nuxt ✅ Succeeded 7m 13s View ↗
Additional runs (36) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-02-05 19:01:35 UTC

'attributes: this.attributes,',
'...(this.hasAttributesInput(this.Wrapper) ? { attributes: this.attributes } : {})'
'attributes: this.wrappedPropsWithAttributes.attributes,',
'...(this.hasAttributesInput(this.Wrapper) ? { attributes: this.wrappedPropsWithAttributes.attributes } : {})'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sidmohanty11 I think I'm breaking this code with this PR. My change here is fine but the ngOnChanges overrides below in this same plugin will stop working:

ngOnChanges(changes: SimpleChanges) { if (changes["attributes"] && !this.hasAttributesInput(this.Wrapper)) { this.ngAfterViewInit(); }

what do you suggest we do about this? Also, is there anything else that will start to break with this approach?

if it's too hard to make the angular SDK happy with not having an attributes prop, i can look into bringing it back in this plugin instead

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samijaber breaking up attributes will mean that we'll lose access to builder-id, style etc so now we'll have to attach all props as HTML attributes and not pass them to be reactive (as inputs). Is it possible to keep the attributes key? because here:

ngAfterViewInit() {
if (!this.hasAttributesInput(this.Wrapper)) {
const wrapperElement =
this.wrapperTemplateRef.elementRef.nativeElement?.nextElementSibling;
if (wrapperElement) {
this.updateAttributes(wrapperElement, this.attributes);
}
}
}

we check if that element doesn't have attributes as an input then we spread it out in the element

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else we can look for only these four: id, style, href and className as attributes and send everything else as inputs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants